#ifndef SOCKET_EXCEPTION_H
#define SOCKET_EXCEPTION_H

#include <string>
#include <cstdio>
#include <exception>

#if defined _WIN32
    #define GET_ERROR (WSAGetLastError())
#else
    #define GET_ERROR (errno)
#endif

class SocketException : public std::exception
{
    private :
    
    std::string m_message;
    int m_errNb;
    
    public :
    
    SocketException(std::string message, int errCode);
    
    ~SocketException() throw();
    
    const char* what() const throw();
    
};

#endif // SOCKET_EXCEPTION_H
